# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Nate Simon <aurpkg (at natesimon.net)>

pkgname=xreader
pkgver=3.8.3
pkgrel=1
pkgdesc="Document viewer for files like PDF and Postscript. X-Apps Project."
arch=(loong64 x86_64)
url="https://github.com/linuxmint/${pkgname}"
license=(GPL)
groups=(x-apps)
depends=(poppler-glib webkit2gtk-4.1 xapp)
optdepends=('djvulibre: support for djvu files'
            'libgxps: support for xps files'
            'libspectre: support for dvi and ps files'
            'mathjax2: support for math in epub files'
            'texlive-bin: support for dvi files')
makedepends=(meson samurai intltool itstool gobject-introspection djvulibre
             libgxps libspectre texlive-bin)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('e7832920dc9d9b953769457d85a016433dfe76c1ab2d392bce92be114397e6b3')
b2sums=('f64f220a86d4a17849e2413fe72e3d147baad6c92e5fae72cf020eae15a04f9fb7ec5785c47617959ca2814f0b07966ca1d4b298d1a5b612fc702c4588e00bf6')

build() {
  arch-meson ${pkgname}-${pkgver} build \
    --libexecdir=lib/${pkgname} \
    -Dmathjax-directory=/usr/share/mathjax2 \
    -Dcomics=true \
    -Ddjvu=true \
    -Ddvi=true \
    -Dt1lib=true \
    -Dpixbuf=true \
    -Dhelp_files=true \
    -Dintrospection=true
  samu -C build
}

package(){
  DESTDIR="${pkgdir}" samu -C build install
}
